<template>
<!--    <h1 v-model="this.peeInfo">{{this.peeInfo['pee_title']}}</h1>-->
  <div class="p-4" style="background-color: white;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)">
    <!--      面包屑-->
    <div class="border-bottom pb-2 mb-4" style="">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/' }"><i class="fa fa-home pr-1" aria-hidden="true"></i>首页</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/KaoYan_Frame/Information' }">考研资讯</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path:this.before_path}">{{this.before_SortName}}</el-breadcrumb-item>
        <el-breadcrumb-item>当前位置</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="info pl-5 pr-5 mb-5">
      <div class="info-body  border-bottom">
        <h5 class="pt-4 pb-5" align="center">{{this.peeInfo.pee_title}}</h5>
        <p class="content">{{this.peeInfo.pee_content}}</p>
        <div class="label pt-5" align="right">
          <p>
            <span class="pr-4">点击率：{{this.peeInfo.pee_ctr}}</span>
            <i class="fa fa-clock-o pr-1" aria-hidden="true"></i>更新时间：{{this.peeInfo.pee_release_time}}
          </p>
          <p>
            <i class="fa fa-user pr-1" aria-hidden="true"></i>
            编辑者：{{this.peeInfo.admin_name}}
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;来源：{{this.peeInfo.pee_source}}
          </p>
        </div>
      </div>
<!--      <div class="mt-2 right" align="right">-->
<!--&lt;!&ndash;        <i class="fa fa-heart-o" aria-hidden="true"></i>&ndash;&gt;-->
<!--&lt;!&ndash;        <i class="fa fa-star fa-2x" aria-hidden="true"></i>&ndash;&gt;-->
<!--&lt;!&ndash;        <span>收藏</span>&ndash;&gt;-->
<!--&lt;!&ndash;        点赞按钮&ndash;&gt;-->
<!--        <button type="button" style="background:transparent;outline:none;display:block;" class="btn btn-default btn-lg">-->
<!--          <span style="color: #1c6285;font-size:20px;" class="fa fa-heart-o fa-3x" aria-hidden="true">-->
<!--            <p class="pl-2" style="float:right;font-size:18px;">收藏</p>-->
<!--          </span>-->
<!--        </button>-->
<!--      </div>-->
    </div>

  </div>
</template>

<script>
import {getPeeInfoByPeeID,addPeeCtrByPeeID} from '@/api/Pee'

export default {
name: "one_info",
  data(){
     return{
       pee_id: this.$route.query.PeeId,
       peeInfo:[],
       before_path:'',
       before_SortName:'',
       pee_category:'',
       pee_ctr:'',

     }
  },
  methods:{
    // 获取具体考研信息
    init(){

      getPeeInfoByPeeID({
        pee_id:this.$route.query.PeeId
      }).then(res=>{
          this.peeInfo=res.data;
          //阅读量自增
          this.pee_ctr=res.data.pee_ctr + 1;
          //提交增加后的阅读量数据
          this.submit();
          this.pee_category=parseInt(res.data.pee_category);
          // console.log(res.data.pee_category);
          if(this.pee_category===1){
            this.before_path='/KaoYan_Frame/KaoYan_Info';
            this.before_SortName='考研信息';
          } else if(this.pee_category==2){
            this.before_path='/KaoYan_Frame/ZhaoShen_Info';
            this.before_SortName='招生信息';
          } else if(this.pee_category==3){
            this.before_path='/KaoYan_Frame/Daily_Info';
            this.before_SortName='考研日报';
          }else if(this.pee_category==4){
            this.before_path='/KaoYan_Frame/Recommend_Info';
            this.before_SortName='特别推荐';
          }else if(this.pee_category==5){
            this.before_path='/KaoYan_Frame/Other_Info';
            this.before_SortName='其他';
          }
      });

    },
    submit(){

      addPeeCtrByPeeID({
        pee_id:this.$route.query.PeeId,
        pee_ctr:this.pee_ctr
      }).then(res=>{
        if(res.data.code==1){
          console.log("阅读量+1")
        }
      })
    },




  },
  created() {
    let _this=this;
    _this.init();
  },
  mounted() {

  }
}
</script>

<style scoped>
.info-body h5{
  font-size: 32px;
  color: #0f5da2;
}
.content{
  font-size: 22px;
  text-indent: 2em;
  letter-spacing:5px;
}
.label{
  color: #6b6e71;
}
</style>
